package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreRoleAddrUsesPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;


@Entity
@NamedQuery(name = "RimCoreRoleAddrUses.findAll",     query = "select o from RimCoreRoleAddrUses o")
@Table(name = "RIM_CORE_ROLE_ADDR_USES")
@IdClass(RimCoreRoleAddrUsesPK.class)
public class RimCoreRoleAddrUses implements Serializable {
    @Id
    @Column(name="ROLE_ID", nullable = false, insertable = false, updatable = false)    private Long roleId;
    @Id
    @Column(name="ROLE_VERSION_NUM", nullable = false, insertable = false,  updatable = false)    private Long roleVersionNum;    
    @Id
    @Column(name="ADDRESS_ID", nullable = false, insertable = false,  updatable = false)    private Long addressId;
    @Id
    @Column(name="ADDRESS_USE_CODE", nullable = false)    private String use;    
    
    @Column(name="PARTY_SITE_USE_ID")    private Long partySiteUseId;
    
    @ManyToOne
    @JoinColumns({
    @JoinColumn(name = "ROLE_ID", referencedColumnName = "ROLE_ID"),
    @JoinColumn(name = "ROLE_VERSION_NUM", referencedColumnName = "ROLE_VERSION_NUM"),
    @JoinColumn(name = "ADDRESS_ID", referencedColumnName = "ADDRESS_ID")
    })
    private RimCoreRoleAddrs rimCoreRoleAddrs;

    public RimCoreRoleAddrUses() {
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public Long getPartySiteUseId() {
        return partySiteUseId;
    }

    public void setPartySiteUseId(Long partySiteUseId) {
        this.partySiteUseId = partySiteUseId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getRoleVersionNum() {
        return roleVersionNum;
    }

    public void setRoleVersionNum(Long roleVersionNum) {
        this.roleVersionNum = roleVersionNum;
    }

    public RimCoreRoleAddrs getRimCoreRoleAddrs() {
        return rimCoreRoleAddrs;
    }

    public void setRimCoreRoleAddrs(RimCoreRoleAddrs rimCoreRoleAddrs) {
        this.rimCoreRoleAddrs = rimCoreRoleAddrs;
    }

    public void setUse(String use) {
        this.use = use;
    }

    public String getUse() {
        return use;
    }
}
